home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  40.5 KB  |  1,149 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    ColorSync API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CMApplication;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CMAPPLICATION__}
  28. {$SETC __CMAPPLICATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CMApplicationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __PRINTING__}
  44. {$I Printing.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMICCPROFILE__}
  47. {$I CMICCProfile.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __DISPLAYS__}
  50. {$I Displays.p}
  51. {$ENDC}
  52.  
  53.  
  54. {$PUSH}
  55. {$ALIGN MAC68K}
  56. {$LibExport+}
  57.  
  58.  
  59. CONST
  60.     kDefaultCMMSignature        = 'appl';
  61.  
  62. { Macintosh 68K trap word }
  63.     cmTrap                        = $ABEE;
  64.  
  65.  
  66. { PicComment IDs }
  67.     cmBeginProfile                = 220;
  68.     cmEndProfile                = 221;
  69.     cmEnableMatching            = 222;
  70.     cmDisableMatching            = 223;
  71.     cmComment                    = 224;
  72.  
  73. { PicComment selectors for cmComment }
  74.     cmBeginProfileSel            = 0;
  75.     cmContinueProfileSel        = 1;
  76.     cmEndProfileSel                = 2;
  77.     cmProfileIdentifierSel        = 3;
  78.  
  79.  
  80. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  81.     cmMatchCMMType                = $00000001;
  82.     cmMatchApplProfileVersion    = $00000002;
  83.     cmMatchDataType                = $00000004;
  84.     cmMatchDeviceType            = $00000008;
  85.     cmMatchDeviceManufacturer    = $00000010;
  86.     cmMatchDeviceModel            = $00000020;
  87.     cmMatchDeviceAttributes        = $00000040;
  88.     cmMatchFlags                = $00000080;
  89.     cmMatchOptions                = $00000100;
  90.     cmMatchWhite                = $00000200;
  91.     cmMatchBlack                = $00000400;
  92.  
  93. { Defines for version 2.0 CMSearchRecord.searchMask }
  94.     cmMatchAnyProfile            = $00000000;
  95.     cmMatchProfileCMMType        = $00000001;
  96.     cmMatchProfileClass            = $00000002;
  97.     cmMatchDataColorSpace        = $00000004;
  98.     cmMatchProfileConnectionSpace = $00000008;
  99.     cmMatchManufacturer            = $00000010;
  100.     cmMatchModel                = $00000020;
  101.     cmMatchAttributes            = $00000040;
  102.     cmMatchProfileFlags            = $00000080;
  103.  
  104. { Result codes }
  105.                                                                 {  General Errors  }
  106.     cmProfileError                = -170;
  107.     cmMethodError                = -171;
  108.     cmMethodNotFound            = -175;                            {  CMM not present  }
  109.     cmProfileNotFound            = -176;                            {  Responder error  }
  110.     cmProfilesIdentical            = -177;                            {  Profiles the same  }
  111.     cmCantConcatenateError        = -178;                            {  Profile can't be concatenated  }
  112.     cmCantXYZ                    = -179;                            {  CMM cant handle XYZ space  }
  113.     cmCantDeleteProfile            = -180;                            {  Responder error  }
  114.     cmUnsupportedDataType        = -181;                            {  Responder error  }
  115.     cmNoCurrentProfile            = -182;                            {  Responder error  }
  116.                                                                 {  Profile Access Errors  }
  117.     cmElementTagNotFound        = -4200;
  118.     cmIndexRangeErr                = -4201;                        {  Tag index out of range  }
  119.     cmCantDeleteElement            = -4202;
  120.     cmFatalProfileErr            = -4203;
  121.     cmInvalidProfile            = -4204;                        {  A Profile must contain a 'cs1 ' tag to be valid  }
  122.     cmInvalidProfileLocation    = -4205;                        {  Operation not supported for this profile location  }
  123.     cmCantCopyModifiedV1Profile    = -4215;                        {  Illegal to copy version 1 profiles that have been modified  }
  124.                                                                 {  Profile Search Errors  }
  125.     cmInvalidSearch                = -4206;                        {  Bad Search Handle  }
  126.     cmSearchError                = -4207;
  127.     cmErrIncompatibleProfile    = -4208;                        {  Other ColorSync Errors  }
  128.     cmInvalidColorSpace            = -4209;                        {  Profile colorspace does not match bitmap type  }
  129.     cmInvalidSrcMap                = -4210;                        {  Source pix/bit map was invalid  }
  130.     cmInvalidDstMap                = -4211;                        {  Destination pix/bit map was invalid  }
  131.     cmNoGDevicesError            = -4212;                        {  Begin/End Matching -- no gdevices available  }
  132.     cmInvalidProfileComment        = -4213;                        {  Bad Profile comment during drawpicture  }
  133.     cmRangeOverFlow                = -4214;                        {  Color conversion warning that some output color values over/underflowed and were clipped  }
  134.     cmNamedColorNotFound        = -4216;                        {  NamedColor not found  }
  135.     cmCantGamutCheckError        = -4217;                        {  Gammut checking not supported by this ColorWorld  }
  136.  
  137. { deviceType values for ColorSync 1.0 Device Profile access }
  138.     cmSystemDevice                = 'sys ';
  139.     cmGDevice                    = 'gdev';
  140.  
  141. { Commands for CMFlattenUPP(…) }
  142.     cmOpenReadSpool                = 1;
  143.     cmOpenWriteSpool            = 2;
  144.     cmReadSpool                    = 3;
  145.     cmWriteSpool                = 4;
  146.     cmCloseSpool                = 5;
  147.  
  148. { Flags for PostScript-related functions }
  149.     cmPS7bit                    = 1;
  150.     cmPS8bit                    = 2;
  151.  
  152. { Flags for profile embedding functions }
  153.     cmEmbedWholeProfile            = $00000000;
  154.     cmEmbedProfileIdentifier    = $00000001;
  155.  
  156. { Commands for CMAccessUPP(…) }
  157.     cmOpenReadAccess            = 1;
  158.     cmOpenWriteAccess            = 2;
  159.     cmReadAccess                = 3;
  160.     cmWriteAccess                = 4;
  161.     cmCloseAccess                = 5;
  162.     cmCreateNewAccess            = 6;
  163.     cmAbortWriteAccess            = 7;
  164.     cmBeginAccess                = 8;
  165.     cmEndAccess                    = 9;
  166.  
  167.  
  168. { Abstract data type for memory-based Profile }
  169.  
  170. TYPE
  171.     CMProfileRef = ^LONGINT;
  172. { Abstract data type for Profile search result }
  173.     CMProfileSearchRef = ^LONGINT;
  174. { Abstract data type for BeginMatching(…) reference }
  175.     CMMatchRef = ^LONGINT;
  176. { Abstract data type for ColorWorld reference }
  177.     CMWorldRef = ^LONGINT;
  178. { Caller-supplied flatten function }
  179. {$IFC TYPED_FUNCTION_POINTERS}
  180.     CMFlattenProcPtr = FUNCTION(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr;
  181. {$ELSEC}
  182.     CMFlattenProcPtr = ProcPtr;
  183. {$ENDC}
  184.  
  185. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  186. {$IFC TYPED_FUNCTION_POINTERS}
  187.     CMBitmapCallBackProcPtr = FUNCTION(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN;
  188. {$ELSEC}
  189.     CMBitmapCallBackProcPtr = ProcPtr;
  190. {$ENDC}
  191.  
  192. { Caller-supplied filter function for Profile search }
  193. {$IFC TYPED_FUNCTION_POINTERS}
  194.     CMProfileFilterProcPtr = FUNCTION(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN;
  195. {$ELSEC}
  196.     CMProfileFilterProcPtr = ProcPtr;
  197. {$ENDC}
  198.  
  199. { Caller-supplied function for profile access }
  200. {$IFC TYPED_FUNCTION_POINTERS}
  201.     CMProfileAccessProcPtr = FUNCTION(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr;
  202. {$ELSEC}
  203.     CMProfileAccessProcPtr = ProcPtr;
  204. {$ENDC}
  205.  
  206.     CMFlattenUPP = UniversalProcPtr;
  207.     CMBitmapCallBackUPP = UniversalProcPtr;
  208.     CMProfileFilterUPP = UniversalProcPtr;
  209.     CMProfileAccessUPP = UniversalProcPtr;
  210.  
  211. CONST
  212.     uppCMFlattenProcInfo = $00003FE0;
  213.     uppCMBitmapCallBackProcInfo = $000003D0;
  214.     uppCMProfileFilterProcInfo = $000003D0;
  215.     uppCMProfileAccessProcInfo = $0000FFE0;
  216.  
  217. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  218.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  219.     INLINE $2E9F;
  220.     {$ENDC}
  221.  
  222. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  223.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  224.     INLINE $2E9F;
  225.     {$ENDC}
  226.  
  227. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  228.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  229.     INLINE $2E9F;
  230.     {$ENDC}
  231.  
  232. FUNCTION NewCMProfileAccessProc(userRoutine: CMProfileAccessProcPtr): CMProfileAccessUPP;
  233.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  234.     INLINE $2E9F;
  235.     {$ENDC}
  236.  
  237. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  238.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  239.     INLINE $205F, $4E90;
  240.     {$ENDC}
  241.  
  242. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  243.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  244.     INLINE $205F, $4E90;
  245.     {$ENDC}
  246.  
  247. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  248.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  249.     INLINE $205F, $4E90;
  250.     {$ENDC}
  251.  
  252. FUNCTION CallCMProfileAccessProc(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMProfileAccessUPP): OSErr;
  253.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  254.     INLINE $205F, $4E90;
  255.     {$ENDC}
  256.  
  257. TYPE
  258.     CMError                                = LONGINT;
  259. { For 1.0 and 2.0 profile header variants }
  260. { CMAppleProfileHeader }
  261.     CMAppleProfileHeaderPtr = ^CMAppleProfileHeader;
  262.     CMAppleProfileHeader = RECORD
  263.         CASE INTEGER OF
  264.         0: (
  265.             cm1:                CMHeader;
  266.             );
  267.         1: (
  268.             cm2:                CM2Header;
  269.             );
  270.     END;
  271.  
  272. { Param for CWConcatColorWorld(…) }
  273.     CMConcatProfileSetPtr = ^CMConcatProfileSet;
  274.     CMConcatProfileSet = RECORD
  275.         keyIndex:                UInt16;                                    {  Zero-based  }
  276.         count:                    UInt16;                                    {  Min 1  }
  277.         profileSet:                ARRAY [0..0] OF CMProfileRef;            {  Variable. Ordered from Source -> Dest  }
  278.     END;
  279.  
  280. { ColorSync color data types }
  281.     CMRGBColorPtr = ^CMRGBColor;
  282.     CMRGBColor = RECORD
  283.         red:                    UInt16;                                    {  0..65535  }
  284.         green:                    UInt16;
  285.         blue:                    UInt16;
  286.     END;
  287.  
  288.     CMCMYKColorPtr = ^CMCMYKColor;
  289.     CMCMYKColor = RECORD
  290.         cyan:                    UInt16;                                    {  0..65535  }
  291.         magenta:                UInt16;
  292.         yellow:                    UInt16;
  293.         black:                    UInt16;
  294.     END;
  295.  
  296.     CMCMYColorPtr = ^CMCMYColor;
  297.     CMCMYColor = RECORD
  298.         cyan:                    UInt16;                                    {  0..65535  }
  299.         magenta:                UInt16;
  300.         yellow:                    UInt16;
  301.     END;
  302.  
  303.     CMHLSColorPtr = ^CMHLSColor;
  304.     CMHLSColor = RECORD
  305.         hue:                    UInt16;                                    {  0..65535. Fraction of circle. Red at 0  }
  306.         lightness:                UInt16;                                    {  0..65535  }
  307.         saturation:                UInt16;                                    {  0..65535  }
  308.     END;
  309.  
  310.     CMHSVColorPtr = ^CMHSVColor;
  311.     CMHSVColor = RECORD
  312.         hue:                    UInt16;                                    {  0..65535. Fraction of circle. Red at 0  }
  313.         saturation:                UInt16;                                    {  0..65535  }
  314.         value:                    UInt16;                                    {  0..65535  }
  315.     END;
  316.  
  317.     CMLabColorPtr = ^CMLabColor;
  318.     CMLabColor = RECORD
  319.         L:                        UInt16;                                    {  0..65535 maps to 0..100  }
  320.         a:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  321.         b:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  322.     END;
  323.  
  324.     CMLuvColorPtr = ^CMLuvColor;
  325.     CMLuvColor = RECORD
  326.         L:                        UInt16;                                    {  0..65535 maps to 0..100  }
  327.         u:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  328.         v:                        UInt16;                                    {  0..65535 maps to -128..127.996  }
  329.     END;
  330.  
  331.     CMYxyColorPtr = ^CMYxyColor;
  332.     CMYxyColor = RECORD
  333.         capY:                    UInt16;                                    {  0..65535 maps to 0..1  }
  334.         x:                        UInt16;                                    {  0..65535 maps to 0..1  }
  335.         y:                        UInt16;                                    {  0..65535 maps to 0..1  }
  336.     END;
  337.  
  338.     CMGrayColorPtr = ^CMGrayColor;
  339.     CMGrayColor = RECORD
  340.         gray:                    UInt16;                                    {  0..65535  }
  341.     END;
  342.  
  343.     CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  344.     CMMultichannel5Color = RECORD
  345.         components:                PACKED ARRAY [0..4] OF UInt8;            {  0..255  }
  346.     END;
  347.  
  348.     CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  349.     CMMultichannel6Color = RECORD
  350.         components:                PACKED ARRAY [0..5] OF UInt8;            {  0..255  }
  351.     END;
  352.  
  353.     CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  354.     CMMultichannel7Color = RECORD
  355.         components:                PACKED ARRAY [0..6] OF UInt8;            {  0..255  }
  356.     END;
  357.  
  358.     CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  359.     CMMultichannel8Color = RECORD
  360.         components:                PACKED ARRAY [0..7] OF UInt8;            {  0..255  }
  361.     END;
  362.  
  363.     CMNamedColorPtr = ^CMNamedColor;
  364.     CMNamedColor = RECORD
  365.         namedColorIndex:        UInt32;                                    {  0..a lot  }
  366.     END;
  367.  
  368.     CMColorPtr = ^CMColor;
  369.     CMColor = RECORD
  370.         CASE INTEGER OF
  371.         0: (
  372.             rgb:                CMRGBColor;
  373.             );
  374.         1: (
  375.             hsv:                CMHSVColor;
  376.             );
  377.         2: (
  378.             hls:                CMHLSColor;
  379.             );
  380.         3: (
  381.             XYZ:                CMXYZColor;
  382.             );
  383.         4: (
  384.             Lab:                CMLabColor;
  385.             );
  386.         5: (
  387.             Luv:                CMLuvColor;
  388.             );
  389.         6: (
  390.             Yxy:                CMYxyColor;
  391.             );
  392.         7: (
  393.             cmyk:                CMCMYKColor;
  394.             );
  395.         8: (
  396.             cmy:                CMCMYColor;
  397.             );
  398.         9: (
  399.             gray:                CMGrayColor;
  400.             );
  401.         10: (
  402.             mc5:                CMMultichannel5Color;
  403.             );
  404.         11: (
  405.             mc6:                CMMultichannel6Color;
  406.             );
  407.         12: (
  408.             mc7:                CMMultichannel7Color;
  409.             );
  410.         13: (
  411.             mc8:                CMMultichannel8Color;
  412.             );
  413.         14: (
  414.             namedColor:            CMNamedColor;
  415.             );
  416.     END;
  417.  
  418.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  419.     CMProfileSearchRecord = RECORD
  420.         header:                    CMHeader;
  421.         fieldMask:                UInt32;
  422.         reserved:                ARRAY [0..1] OF UInt32;
  423.     END;
  424.  
  425.     CMProfileSearchRecordHandle            = ^CMProfileSearchRecordPtr;
  426. { Search definition for 2.0 }
  427.     CMSearchRecordPtr = ^CMSearchRecord;
  428.     CMSearchRecord = RECORD
  429.         CMMType:                OSType;
  430.         profileClass:            OSType;
  431.         dataColorSpace:            OSType;
  432.         profileConnectionSpace:    OSType;
  433.         deviceManufacturer:        UInt32;
  434.         deviceModel:            UInt32;
  435.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  436.         profileFlags:            UInt32;
  437.         searchMask:                UInt32;
  438.         filter:                    CMProfileFilterUPP;
  439.     END;
  440.  
  441. { GetCWInfo structures }
  442.     CMMInfoRecordPtr = ^CMMInfoRecord;
  443.     CMMInfoRecord = RECORD
  444.         CMMType:                OSType;
  445.         CMMVersion:                LONGINT;
  446.     END;
  447.  
  448.     CMCWInfoRecordPtr = ^CMCWInfoRecord;
  449.     CMCWInfoRecord = RECORD
  450.         cmmCount:                UInt32;
  451.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  452.     END;
  453.  
  454. { profile identifier structures }
  455.     CMProfileIdentifierPtr = ^CMProfileIdentifier;
  456.     CMProfileIdentifier = RECORD
  457.         profileHeader:            CM2Header;
  458.         calibrationDate:        CMDateTime;
  459.         ASCIIProfileDescriptionLen: UInt32;
  460.         ASCIIProfileDescription: SInt8;                                    {  variable length  }
  461.     END;
  462.  
  463. { packing formats }
  464.  
  465. CONST
  466.     cmNoColorPacking            = $0000;
  467.     cmAlphaSpace                = $0080;
  468.     cmWord5ColorPacking            = $0500;
  469.     cmLong8ColorPacking            = $0800;
  470.     cmLong10ColorPacking        = $0A00;
  471.     cmAlphaFirstPacking            = $1000;
  472.     cmOneBitDirectPacking        = $0B00;
  473.     cmAlphaLastPacking            = $0000;
  474.     cm24_8ColorPacking            = $2100;
  475.     cm32_8ColorPacking            = $0800;
  476.     cm40_8ColorPacking            = $2200;
  477.     cm48_8ColorPacking            = $2300;
  478.     cm56_8ColorPacking            = $2400;
  479.     cm64_8ColorPacking            = $2500;
  480.     cm32_16ColorPacking            = $2600;
  481.     cm48_16ColorPacking            = $2900;
  482.     cm64_16ColorPacking            = $2A00;
  483.     cm32_32ColorPacking            = $2700;
  484.  
  485. { general colorspaces }
  486.     cmNoSpace                    = 0;
  487.     cmRGBSpace                    = 1;
  488.     cmCMYKSpace                    = 2;
  489.     cmHSVSpace                    = 3;
  490.     cmHLSSpace                    = 4;
  491.     cmYXYSpace                    = 5;
  492.     cmXYZSpace                    = 6;
  493.     cmLUVSpace                    = 7;
  494.     cmLABSpace                    = 8;
  495.     cmReservedSpace1            = 9;
  496.     cmGraySpace                    = 10;
  497.     cmReservedSpace2            = 11;
  498.     cmGamutResultSpace            = 12;
  499.     cmNamedIndexedSpace            = 16;
  500.     cmMCFiveSpace                = 17;
  501.     cmMCSixSpace                = 18;
  502.     cmMCSevenSpace                = 19;
  503.     cmMCEightSpace                = 20;
  504.     cmRGBASpace                    = 129;
  505.     cmGrayASpace                = 138;
  506.  
  507. { supported CMBitmapColorSpaces - each of the following is a }
  508. { combination of a general colospace and a packing formats }
  509.     cmGray16Space                = 10;
  510.     cmGrayA32Space                = 138;
  511.     cmRGB16Space                = $0501;
  512.     cmRGB24Space                = $2101;
  513.     cmRGB32Space                = $0801;
  514.     cmRGB48Space                = $2901;
  515.     cmARGB32Space                = $1881;
  516.     cmRGBA32Space                = $0881;
  517.     cmCMYK32Space                = $0802;
  518.     cmCMYK64Space                = $2A02;
  519.     cmHSV32Space                = $0A03;
  520.     cmHLS32Space                = $0A04;
  521.     cmYXY32Space                = $0A05;
  522.     cmXYZ32Space                = $0A06;
  523.     cmLUV32Space                = $0A07;
  524.     cmLAB24Space                = $2108;
  525.     cmLAB32Space                = $0A08;
  526.     cmLAB48Space                = $2908;
  527.     cmGamutResult1Space            = $0B0C;
  528.     cmNamedIndexed32Space        = $2710;
  529.     cmMCFive8Space                = $2211;
  530.     cmMCSix8Space                = $2312;
  531.     cmMCSeven8Space                = $2413;
  532.     cmMCEight8Space                = $2514;
  533.  
  534.  
  535.  
  536. TYPE
  537.     CMBitmapColorSpace                    = UInt32;
  538.     CMBitmapPtr = ^CMBitmap;
  539.     CMBitmap = RECORD
  540.         image:                    CStringPtr;
  541.         width:                    LONGINT;
  542.         height:                    LONGINT;
  543.         rowBytes:                LONGINT;
  544.         pixelSize:                LONGINT;
  545.         space:                    CMBitmapColorSpace;
  546.         user1:                    LONGINT;
  547.         user2:                    LONGINT;
  548.     END;
  549.  
  550.  
  551. { Classic Print Manager Stuff }
  552.  
  553. CONST
  554.     enableColorMatchingOp        = 12;
  555.     registerProfileOp            = 13;
  556.  
  557.     cmNoProfileBase                = 0;
  558.     cmFileBasedProfile            = 1;
  559.     cmHandleBasedProfile        = 2;
  560.     cmPtrBasedProfile            = 3;
  561.     cmProcedureBasedProfile        = 4;
  562.  
  563.  
  564. TYPE
  565.     CMFileLocationPtr = ^CMFileLocation;
  566.     CMFileLocation = RECORD
  567.         spec:                    FSSpec;
  568.     END;
  569.  
  570.     CMHandleLocationPtr = ^CMHandleLocation;
  571.     CMHandleLocation = RECORD
  572.         h:                        Handle;
  573.     END;
  574.  
  575.     CMPtrLocationPtr = ^CMPtrLocation;
  576.     CMPtrLocation = RECORD
  577.         p:                        Ptr;
  578.     END;
  579.  
  580.     CMProcedureLocationPtr = ^CMProcedureLocation;
  581.     CMProcedureLocation = RECORD
  582.         proc:                    CMProfileAccessUPP;
  583.         refCon:                    Ptr;
  584.     END;
  585.  
  586.  
  587.     CMProfLocPtr = ^CMProfLoc;
  588.     CMProfLoc = RECORD
  589.         CASE INTEGER OF
  590.         0: (
  591.             fileLoc:            CMFileLocation;
  592.             );
  593.         1: (
  594.             handleLoc:            CMHandleLocation;
  595.             );
  596.         2: (
  597.             ptrLoc:                CMPtrLocation;
  598.             );
  599.         3: (
  600.             procLoc:            CMProcedureLocation;
  601.             );
  602.     END;
  603.  
  604.     CMProfileLocationPtr = ^CMProfileLocation;
  605.     CMProfileLocation = RECORD
  606.         locType:                INTEGER;
  607.         u:                        CMProfLoc;
  608.     END;
  609.  
  610.  
  611. CONST
  612.     cmOriginalProfileLocationSize = 72;
  613.     cmCurrentProfileLocationSize = 72;
  614.  
  615.  
  616. { Struct and enums used for Profile iteration }
  617.     cmProfileIterateDataVersion1 = $00010000;
  618.  
  619.  
  620. TYPE
  621.     CMProfileIterateDataPtr = ^CMProfileIterateData;
  622.     CMProfileIterateData = RECORD
  623.         dataVersion:            UInt32;                                    {  cmProfileIterateDataVersion1  }
  624.         header:                    CM2Header;
  625.         code:                    ScriptCode;
  626.         name:                    Str255;
  627.         location:                CMProfileLocation;
  628.     END;
  629.  
  630. { Caller-supplied callback function for Profile iteration }
  631. {$IFC TYPED_FUNCTION_POINTERS}
  632.     CMProfileIterateProcPtr = FUNCTION(VAR iterateData: CMProfileIterateData; refCon: UNIV Ptr): OSErr;
  633. {$ELSEC}
  634.     CMProfileIterateProcPtr = ProcPtr;
  635. {$ENDC}
  636.  
  637.     CMProfileIterateUPP = UniversalProcPtr;
  638.  
  639. CONST
  640.     uppCMProfileIterateProcInfo = $000003E0;
  641.  
  642. FUNCTION NewCMProfileIterateProc(userRoutine: CMProfileIterateProcPtr): CMProfileIterateUPP;
  643.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  644.     INLINE $2E9F;
  645.     {$ENDC}
  646.  
  647. FUNCTION CallCMProfileIterateProc(VAR iterateData: CMProfileIterateData; refCon: UNIV Ptr; userRoutine: CMProfileIterateUPP): OSErr;
  648.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  649.     INLINE $205F, $4E90;
  650.     {$ENDC}
  651. { Profile file and element access }
  652. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  653.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  654.     INLINE $203C, $0008, $001B, $ABEE;
  655.     {$ENDC}
  656. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  657.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  658.     INLINE $203C, $0008, $001C, $ABEE;
  659.     {$ENDC}
  660. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  661.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  662.     INLINE $203C, $0004, $001D, $ABEE;
  663.     {$ENDC}
  664. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  665.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  666.     INLINE $203C, $0004, $0034, $ABEE;
  667.     {$ENDC}
  668. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  669.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  670.     INLINE $203C, $000C, $0025, $ABEE;
  671.     {$ENDC}
  672. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  673.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  674.     INLINE $203C, $000C, $0026, $ABEE;
  675.     {$ENDC}
  676. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  677.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  678.     INLINE $203C, $0008, $003C, $ABEE;
  679.     {$ENDC}
  680. FUNCTION NCMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation; VAR locationSize: UInt32): CMError;
  681.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  682.     INLINE $203C, $000C, $0059, $ABEE;
  683.     {$ENDC}
  684. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  685.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  686.     INLINE $203C, $0014, $0031, $ABEE;
  687.     {$ENDC}
  688. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  689.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  690.     INLINE $203C, $0010, $0032, $ABEE;
  691.     {$ENDC}
  692. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  693.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  694.     INLINE $203C, $0008, $0039, $ABEE;
  695.     {$ENDC}
  696. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  697.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  698.     INLINE $203C, $0008, $003A, $ABEE;
  699.     {$ENDC}
  700. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  701.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  702.     INLINE $203C, $000C, $001E, $ABEE;
  703.     {$ENDC}
  704. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: UInt32): CMError;
  705.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  706.     INLINE $203C, $0008, $001F, $ABEE;
  707.     {$ENDC}
  708. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: UInt32; elementData: UNIV Ptr): CMError;
  709.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  710.     INLINE $203C, $0010, $0020, $ABEE;
  711.     {$ENDC}
  712. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: UInt32; elementData: UNIV Ptr): CMError;
  713.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  714.     INLINE $203C, $0010, $0023, $ABEE;
  715.     {$ENDC}
  716. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: UInt32): CMError;
  717.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  718.     INLINE $203C, $000C, $0038, $ABEE;
  719.     {$ENDC}
  720. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  721.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  722.     INLINE $203C, $000C, $0035, $ABEE;
  723.     {$ENDC}
  724. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; VAR byteCount: UInt32; elementData: UNIV Ptr): CMError;
  725.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  726.     INLINE $203C, $0014, $0036, $ABEE;
  727.     {$ENDC}
  728. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; byteCount: UInt32; elementData: UNIV Ptr): CMError;
  729.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  730.     INLINE $203C, $0014, $0037, $ABEE;
  731.     {$ENDC}
  732. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: UInt32; VAR tag: OSType; VAR elementSize: UInt32; VAR refs: BOOLEAN): CMError;
  733.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  734.     INLINE $203C, $0014, $0021, $ABEE;
  735.     {$ENDC}
  736. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: UInt32; VAR elementSize: UInt32; elementData: UNIV Ptr): CMError;
  737.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  738.     INLINE $203C, $0010, $0022, $ABEE;
  739.     {$ENDC}
  740. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  741.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  742.     INLINE $203C, $0008, $0024, $ABEE;
  743.     {$ENDC}
  744. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  745.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  746.     INLINE $203C, $000C, $003E, $ABEE;
  747.     {$ENDC}
  748. FUNCTION CMCloneProfileRef(prof: CMProfileRef): CMError;
  749.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  750.     INLINE $203C, $0004, $0042, $ABEE;
  751.     {$ENDC}
  752. FUNCTION CMGetProfileRefCount(prof: CMProfileRef; VAR count: LONGINT): CMError;
  753.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  754.     INLINE $203C, $0008, $0043, $ABEE;
  755.     {$ENDC}
  756. FUNCTION CMProfileModified(prof: CMProfileRef; VAR modified: BOOLEAN): CMError;
  757.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  758.     INLINE $203C, $0008, $0044, $ABEE;
  759.     {$ENDC}
  760.  
  761. { named Color access functions }
  762. FUNCTION CMGetNamedColorInfo(prof: CMProfileRef; VAR deviceChannels: UInt32; VAR deviceColorSpace: OSType; VAR PCSColorSpace: OSType; VAR count: UInt32; prefix: StringPtr; suffix: StringPtr): CMError;
  763.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  764.     INLINE $203C, $001C, $0046, $ABEE;
  765.     {$ENDC}
  766. FUNCTION CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  767.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  768.     INLINE $203C, $0010, $0047, $ABEE;
  769.     {$ENDC}
  770. FUNCTION CMGetIndNamedColorValue(prof: CMProfileRef; index: UInt32; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  771.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  772.     INLINE $203C, $0010, $0048, $ABEE;
  773.     {$ENDC}
  774. FUNCTION CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; VAR index: UInt32): CMError;
  775.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  776.     INLINE $203C, $000C, $0049, $ABEE;
  777.     {$ENDC}
  778. FUNCTION CMGetNamedColorName(prof: CMProfileRef; index: UInt32; name: StringPtr): CMError;
  779.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  780.     INLINE $203C, $000C, $004A, $ABEE;
  781.     {$ENDC}
  782.  
  783. { Low-level matching functions }
  784. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  785.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  786.     INLINE $203C, $000C, $0014, $ABEE;
  787.     {$ENDC}
  788. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  789.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  790.     INLINE $203C, $0008, $0015, $ABEE;
  791.     {$ENDC}
  792. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  793.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  794.     INLINE $203C, $000C, $0033, $ABEE;
  795.     {$ENDC}
  796. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  797.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  798.     INLINE $203C, $0004, $0001, $ABEE;
  799.     {$ENDC}
  800. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: UInt32): CMError;
  801.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  802.     INLINE $203C, $000C, $0002, $ABEE;
  803.     {$ENDC}
  804. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: UInt32; VAR result: LONGINT): CMError;
  805.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  806.     INLINE $203C, $0010, $0003, $ABEE;
  807.     {$ENDC}
  808.  
  809. { Bitmap matching }
  810. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  811.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  812.     INLINE $203C, $0010, $002C, $ABEE;
  813.     {$ENDC}
  814. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  815.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  816.     INLINE $203C, $0014, $002D, $ABEE;
  817.     {$ENDC}
  818.  
  819. { Quickdraw-specific matching }
  820. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  821.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  822.     INLINE $203C, $0010, $0004, $ABEE;
  823.     {$ENDC}
  824. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  825.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  826.     INLINE $203C, $0014, $0007, $ABEE;
  827.     {$ENDC}
  828. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  829.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  830.     INLINE $203C, $000C, $0016, $ABEE;
  831.     {$ENDC}
  832. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  833.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  834.     INLINE $203C, $0004, $000B, $ABEE;
  835.     {$ENDC}
  836. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  837.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  838.     INLINE $203C, $000C, $0017, $ABEE;
  839.     {$ENDC}
  840. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  841.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  842.     INLINE $203C, $0002, $000D, $ABEE;
  843.     {$ENDC}
  844. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: UInt32): CMError;
  845.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  846.     INLINE $203C, $0008, $003B, $ABEE;
  847.     {$ENDC}
  848. FUNCTION CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; VAR size: UInt32): CMError;
  849.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  850.     INLINE $203C, $000C, $0041, $ABEE;
  851.     {$ENDC}
  852.  
  853. { System Profile access }
  854. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  855.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  856.     INLINE $203C, $0004, $0018, $ABEE;
  857.     {$ENDC}
  858. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  859.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  860.     INLINE $203C, $0004, $0019, $ABEE;
  861.     {$ENDC}
  862. FUNCTION CMGetDefaultProfileBySpace(dataColorSpace: OSType; VAR prof: CMProfileRef): CMError;
  863.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  864.     INLINE $203C, $0008, $005A, $ABEE;
  865.     {$ENDC}
  866. FUNCTION CMSetDefaultProfileBySpace(dataColorSpace: OSType; prof: CMProfileRef): CMError;
  867.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  868.     INLINE $203C, $0008, $005B, $ABEE;
  869.     {$ENDC}
  870. FUNCTION CMGetProfileByAVID(theAVID: AVIDType; VAR prof: CMProfileRef): CMError;
  871.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  872.     INLINE $203C, $0008, $005C, $ABEE;
  873.     {$ENDC}
  874. FUNCTION CMSetProfileByAVID(theAVID: AVIDType; prof: CMProfileRef): CMError;
  875.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  876.     INLINE $203C, $0008, $005D, $ABEE;
  877.     {$ENDC}
  878.  
  879. { External Profile Management }
  880. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: UInt32; VAR searchResult: CMProfileSearchRef): CMError;
  881.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  882.     INLINE $203C, $0010, $0027, $ABEE;
  883.     {$ENDC}
  884. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: UInt32): CMError;
  885.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  886.     INLINE $203C, $000C, $0028, $ABEE;
  887.     {$ENDC}
  888. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  889.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  890.     INLINE $203C, $0004, $0029, $ABEE;
  891.     {$ENDC}
  892. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: UInt32; VAR prof: CMProfileRef): CMError;
  893.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  894.     INLINE $203C, $000C, $002A, $ABEE;
  895.     {$ENDC}
  896. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: UInt32; VAR profileFile: FSSpec): CMError;
  897.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  898.     INLINE $203C, $000C, $002B, $ABEE;
  899.     {$ENDC}
  900. FUNCTION CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; VAR matchedCount: UInt32; VAR searchResult: CMProfileSearchRef): CMError;
  901.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  902.     INLINE $203C, $000C, $003F, $ABEE;
  903.     {$ENDC}
  904. FUNCTION CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; VAR profileList: CMProfileRef; listSize: UInt32; VAR matchedCount: UInt32; VAR matchedList: CMProfileRef): CMError;
  905.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  906.     INLINE $203C, $0014, $0040, $ABEE;
  907.     {$ENDC}
  908. FUNCTION CMIterateColorSyncFolder(proc: CMProfileIterateUPP; VAR seed: UInt32; VAR count: UInt32; refCon: UNIV Ptr): CMError;
  909.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  910.     INLINE $203C, $0010, $0058, $ABEE;
  911.     {$ENDC}
  912.  
  913. { Utilities }
  914. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  915.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  916.     INLINE $203C, $000C, $0011, $ABEE;
  917.     {$ENDC}
  918. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  919.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  920.     INLINE $203C, $0008, $001A, $ABEE;
  921.     {$ENDC}
  922. FUNCTION CMConvertProfile2to1(profv2: CMProfileRef; VAR profv1: CMProfileHandle): CMError;
  923.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  924.     INLINE $203C, $0008, $0045, $ABEE;
  925.     {$ENDC}
  926. FUNCTION CMGetPreferredCMM(VAR cmmType: OSType; VAR preferredCMMnotfound: BOOLEAN): CMError;
  927.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  928.     INLINE $203C, $0008, $005E, $ABEE;
  929.     {$ENDC}
  930.  
  931.  
  932. { ColorSpace conversion functions }
  933. FUNCTION CMConvertXYZToLab({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  934.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  935.     INLINE $203C, $0010, $004B, $ABEE;
  936.     {$ENDC}
  937. FUNCTION CMConvertLabToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  938.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  939.     INLINE $203C, $0010, $004C, $ABEE;
  940.     {$ENDC}
  941. FUNCTION CMConvertXYZToLuv({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  942.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  943.     INLINE $203C, $0010, $004D, $ABEE;
  944.     {$ENDC}
  945. FUNCTION CMConvertLuvToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: UInt32): CMError;
  946.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  947.     INLINE $203C, $0010, $004E, $ABEE;
  948.     {$ENDC}
  949. FUNCTION CMConvertXYZToYxy({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  950.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  951.     INLINE $203C, $000C, $004F, $ABEE;
  952.     {$ENDC}
  953. FUNCTION CMConvertYxyToXYZ({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  954.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  955.     INLINE $203C, $000C, $0050, $ABEE;
  956.     {$ENDC}
  957. FUNCTION CMConvertRGBToHLS({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  958.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  959.     INLINE $203C, $000C, $0051, $ABEE;
  960.     {$ENDC}
  961. FUNCTION CMConvertHLSToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  962.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  963.     INLINE $203C, $000C, $0052, $ABEE;
  964.     {$ENDC}
  965. FUNCTION CMConvertRGBToHSV({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  966.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  967.     INLINE $203C, $000C, $0053, $ABEE;
  968.     {$ENDC}
  969. FUNCTION CMConvertHSVToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  970.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  971.     INLINE $203C, $000C, $0054, $ABEE;
  972.     {$ENDC}
  973. FUNCTION CMConvertRGBToGray({CONST}VAR src: CMColor; VAR dst: CMColor; count: UInt32): CMError;
  974.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  975.     INLINE $203C, $000C, $0055, $ABEE;
  976.     {$ENDC}
  977. FUNCTION CMConvertXYZToFixedXYZ({CONST}VAR src: CMXYZColor; VAR dst: CMFixedXYZColor; count: UInt32): CMError;
  978.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  979.     INLINE $203C, $000C, $0056, $ABEE;
  980.     {$ENDC}
  981. FUNCTION CMConvertFixedXYZToXYZ({CONST}VAR src: CMFixedXYZColor; VAR dst: CMXYZColor; count: UInt32): CMError;
  982.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  983.     INLINE $203C, $000C, $0057, $ABEE;
  984.     {$ENDC}
  985. { PS-related }
  986. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  987.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  988.     INLINE $203C, $0014, $002E, $ABEE;
  989.     {$ENDC}
  990. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  991.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  992.     INLINE $203C, $0014, $002F, $ABEE;
  993.     {$ENDC}
  994. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  995.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  996.     INLINE $203C, $0018, $0030, $ABEE;
  997.     {$ENDC}
  998. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: UInt32; VAR preferredCMMnotfound: BOOLEAN): CMError;
  999.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1000.     INLINE $203C, $0010, $003D, $ABEE;
  1001.     {$ENDC}
  1002.  
  1003. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  1004. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  1005.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1006.     INLINE $203C, $000C, $0000, $ABEE;
  1007.     {$ENDC}
  1008. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  1009.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1010.     INLINE $203C, $000C, $000C, $ABEE;
  1011.     {$ENDC}
  1012. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  1013.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1014.     INLINE $203C, $000C, $000A, $ABEE;
  1015.     {$ENDC}
  1016. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  1017.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1018.     INLINE $203C, $000C, $0009, $ABEE;
  1019.     {$ENDC}
  1020. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  1021.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1022.     INLINE $203C, $0004, $0008, $ABEE;
  1023.     {$ENDC}
  1024. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  1025.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1026.     INLINE $203C, $0008, $000E, $ABEE;
  1027.     {$ENDC}
  1028. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  1029.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1030.     INLINE $203C, $0004, $000F, $ABEE;
  1031.     {$ENDC}
  1032.  
  1033. { ProfileResponder functions }
  1034. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  1035.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1036.     INLINE $203C, $0010, $0005, $ABEE;
  1037.     {$ENDC}
  1038. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  1039.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1040.     INLINE $203C, $000C, $0006, $ABEE;
  1041.     {$ENDC}
  1042. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  1043.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1044.     INLINE $203C, $0010, $0010, $ABEE;
  1045.     {$ENDC}
  1046. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  1047.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1048.     INLINE $203C, $0014, $0012, $ABEE;
  1049.     {$ENDC}
  1050. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  1051.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1052.     INLINE $203C, $000C, $0013, $ABEE;
  1053.     {$ENDC}
  1054.  
  1055. {$IFC OLDROUTINENAMES }
  1056. { constants }
  1057.  
  1058. CONST
  1059.     kMatchCMMType                = $00000001;
  1060.     kMatchApplProfileVersion    = $00000002;
  1061.     kMatchDataType                = $00000004;
  1062.     kMatchDeviceType            = $00000008;
  1063.     kMatchDeviceManufacturer    = $00000010;
  1064.     kMatchDeviceModel            = $00000020;
  1065.     kMatchDeviceAttributes        = $00000040;
  1066.     kMatchFlags                    = $00000080;
  1067.     kMatchOptions                = $00000100;
  1068.     kMatchWhite                    = $00000200;
  1069.     kMatchBlack                    = $00000400;
  1070.  
  1071. { types }
  1072.  
  1073. TYPE
  1074.     CMYKColor                            = CMCMYKColor;
  1075.     CMYKColorPtr                         = ^CMYKColor;
  1076.     CWorld                                = CMWorldRef;
  1077.     CMGamutResult                        = ^LONGINT;
  1078. { functions }
  1079. PROCEDURE EndMatching(myRef: CMMatchRef);
  1080.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1081.     INLINE $203C, $0004, $000B, $ABEE;
  1082.     {$ENDC}
  1083. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  1084.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1085.     INLINE $203C, $0002, $000D, $ABEE;
  1086.     {$ENDC}
  1087. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  1088.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1089.     INLINE $203C, $000C, $0011, $ABEE;
  1090.     {$ENDC}
  1091. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  1092.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1093.     INLINE $203C, $000C, $000A, $ABEE;
  1094.     {$ENDC}
  1095. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  1096.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1097.     INLINE $203C, $000C, $0009, $ABEE;
  1098.     {$ENDC}
  1099. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  1100.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1101.     INLINE $203C, $0004, $0008, $ABEE;
  1102.     {$ENDC}
  1103. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  1104.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1105.     INLINE $203C, $0008, $000E, $ABEE;
  1106.     {$ENDC}
  1107. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  1108.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1109.     INLINE $203C, $0004, $000F, $ABEE;
  1110.     {$ENDC}
  1111. {$ENDC}  {OLDROUTINENAMES}
  1112.  
  1113.  
  1114. {  Deprecated stuff }
  1115.  
  1116. { PrGeneral parameter blocks }
  1117.  
  1118. TYPE
  1119.     TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  1120.     TEnableColorMatchingBlk = RECORD
  1121.         iOpCode:                INTEGER;
  1122.         iError:                    INTEGER;
  1123.         lReserved:                LONGINT;
  1124.         hPrint:                    THPrint;
  1125.         fEnableIt:                BOOLEAN;
  1126.         filler:                    SInt8;
  1127.     END;
  1128.  
  1129.     TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  1130.     TRegisterProfileBlk = RECORD
  1131.         iOpCode:                INTEGER;
  1132.         iError:                    INTEGER;
  1133.         lReserved:                LONGINT;
  1134.         hPrint:                    THPrint;
  1135.         fRegisterIt:            BOOLEAN;
  1136.         filler:                    SInt8;
  1137.     END;
  1138.  
  1139. {$ALIGN RESET}
  1140. {$POP}
  1141.  
  1142. {$SETC UsingIncludes := CMApplicationIncludes}
  1143.  
  1144. {$ENDC} {__CMAPPLICATION__}
  1145.  
  1146. {$IFC NOT UsingIncludes}
  1147.  END.
  1148. {$ENDC}
  1149.